<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition
	xmlns="http://www.w3.org/1999/xhtml"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:c="http://java.sun.com/jsp/jstl/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:p="http://primefaces.prime.com.tr/ui"
	template="/WEB-INF/templates/layoutCourtier.xhtml">
	

<ui:define name="content">

<p:panel header="#{msgs.titrePanelPrincipal}" style="width:1200px;height:800px;">
 
<p:panel style="width:100%;height:100%;">

<h:panelGrid columns="2" cellpadding="2" border="1">

<p:graphicImage value="images/network2.png"/> 

<h:outputText value="___________#{msgs.corbeille}__________jslfjdslfjdslkfjdslkfjdskl" />
 
</h:panelGrid>
</p:panel>

 <h:form>  
   
     <p:growl id="messages"/>  
   
  <p:menubar autoSubmenuDisplay="true">  
         <p:submenu label="#{msgs.menuNouveau}" icon="ui-icon ui-icon-pencil">    
            <p:menuitem value="#{msgs.client}" action="#{manage.versnouveauclient}" ajax="false"/>  
          	<p:menuitem value="#{msgs.assureur}" action="#{manage.versnouvelassureur}" ajax="false"/>
          	<p:menuitem value="#{msgs.police}" action="#{manage.versnouvellepolice}" ajax="false"/>
          	<p:menuitem value="#{msgs.sinistre}" action="#{manage.versnouveausinistre}" ajax="false"/>
         </p:submenu>         
         
		<p:submenu label="#{msgs.menuListes}" icon="ui-icon ui-icon-star">  
			<p:menuitem value="#{msgs.listeClients}" action="verslisteclients" /> 
            <p:menuitem value="#{msgs.listeAssureurs}" action="verslisteassureurs" />  
            <p:menuitem value="#{msgs.listePolices}" action="verslistepolices" /> 
            <p:menuitem value="#{msgs.listeSinistres}" action="verslistesinistres" />
         </p:submenu>   			
        
         			  
         <p:submenu label="#{msgs.menuStatistiques}" icon="ui-icon ui-icon-star">  
             <p:menuitem value="#{msgs.sinistralité}" action="verslistepolices" />  
               
         </p:submenu>
         
         <p:submenu label="#{msgs.menuAide}" icon="ui-icon ui-icon-help">  
             <p:menuitem value="#{msgs.menuAide}" url="#" />  
               
         </p:submenu>
         
         <p:submenu label="#{msgs.corbeille}" icon="ui-icon ui-icon-help">  
             <p:menuitem value="#{msgs.elementsSupprimes}" url="#" />  
               
         </p:submenu>

     </p:menubar>  
   
 </h:form>  
 
<h:form>
    
<p:dataTable var="client"
			value="#{manage.serviceClient.tousLesClients}" 
	 		widgetVar="client"   
			emptyMessage="Pas de client correspondant au critère de recherche"
			paginator="true"
			rows="10" rowKey="#{client.key}"
			selection="#{manage.clientChoisi}"
			selectionMode="single"
			paginatorTemplate="{CurrentPageReport}  {FirstPageLink} {PreviousPageLink} {PageLinks} 
			{NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
			rowsPerPageTemplate="5,10,15">
		
 		
<p:column filterBy="#{client.raisonSociale}" filterMatchMode="contains">
<f:facet name="header">
<h:outputText value="#{msgs.raisonSociale}" />
</f:facet>
<h:outputText value="#{client.raisonSociale}" />
</p:column>

<p:column>
<f:facet name="header">
<h:outputText value="#{msgs.domaineActivite}" />
</f:facet>
<h:outputText value="#{client.domaineActivite}" />
</p:column>

<p:column >
<f:facet name="header">
<h:outputText value="#{msgs.responsable}" />
</f:facet>
<h:outputText value="#{client.responsable}" />
</p:column>

<p:column >
<f:facet name="header">
<h:outputText value="#{msgs.adresse}" />
</f:facet>
<h:outputText value="#{client.adresse}" />
</p:column>

<p:column >
<f:facet name="header">
<h:outputText value="#{msgs.numeroTel}" />
</f:facet>
<h:outputText value="#{client.telephone}" />
</p:column>

<p:column>
<f:facet name="header">
<h:outputText value="#{msgs.email}" />
</f:facet>
<h:outputText value="#{client.email}" />
</p:column>
		
<f:facet name="footer">

<p:commandButton value="#{msgs.modifier}" image="ui-icon ui-icon-search"  
update="display1" oncomplete="modif.show()"/> 

<p:commandButton value="#{msgs.supprimer}" image="ui-icon ui-icon-pencil"  
action="#{manage.supprimerClient}"/>  

<p:commandButton value="#{msgs.apercuPolices}" image="ui-icon ui-icon-search"  
update="display2" oncomplete="police.show()"/>  


<p:dialog header="#{msgs.cliqueModif}:" widgetVar="modif" resizable="false"  
               width="700" showEffect="clip" hideEffect="fold">  
   
 <h:panelGrid id="display1" columns="2" cellpadding="4">  
   

<h:outputText value="#{msgs.raisonSociale}:" />  
<p:inplace>  
<p:inputText value="#{manage.client.raisonSociale}" />  
</p:inplace> 

<h:outputText value="#{msgs.domaineActivite}:"/>  
<p:inplace>  
<p:inputText value="#{manage.client.domaineActivite}" />  
</p:inplace> 

<h:outputText value="#{msgs.adresse}:"/>  
<p:inplace>  
<p:inputText value="#{manage.client.adresse}" />  
</p:inplace>

<h:outputText value="#{msgs.responsable}:"/>  
<p:inplace>  
<p:inputText value="#{manage.client.responsable}"/>  
</p:inplace>

<h:outputText value="#{msgs.numeroTel}:" />  
<p:inplace>  
<p:inputText value="#{manage.client.telephone}"/>  
</p:inplace>

<h:outputText value="#{msgs.email}:" />  
<p:inplace>  
<p:inputText value="#{manage.client.email}"/>  
</p:inplace>
             
 <p:commandButton image="ui-icon ui-icon-disk" style="width:120px"
	value="#{msgs.enregistrer}" action="verslisteclients" 
	ajax="false" />  
</h:panelGrid>  
             
</p:dialog>


<p:dialog header="Polices" widgetVar="police" resizable="false"  
               width="700" showEffect="clip" hideEffect="fold">  

   
         <h:panelGrid id="display2" columns="2" cellpadding="4">  
   
         <p:dataGrid var="police" value="#{manage.clientChoisi.listePolices}" columns="3"  
         rows="3" paginator="true" effect="true"  
         paginatorTemplate="{CurrentPageReport}  {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"  
         rowsPerPageTemplate="3,5,7">  
           
         <p:column>  
             <p:panel header="#{police.numeroPolice}" style="text-align:center">  
                 <h:panelGrid columns="1" style="width:100%">
                 
        <p:column>		
		<h:outputText value="#{msgs.dateDebut}: " />
		<h:outputText value="#{police.dateDebut}">
		<f:convertDateTime dateStyle="short"/>
		</h:outputText>
		</p:column>
		
        <p:column>		
		<h:outputText value="#{msgs.dateFin}: " />
		<h:outputText value="#{police.dateFin}">
		<f:convertDateTime dateStyle="short"/>
		</h:outputText>
		</p:column>
		
         <p:column>      
         <h:outputText value="#{msgs.prime}: " />	
         <h:outputText value="#{police.prime}" />  
         </p:column>
     
            </h:panelGrid>  
             </p:panel>  
         </p:column>  
   
     </p:dataGrid>  
          
</h:panelGrid>  



</p:dialog>             
				
</f:facet>

            

</p:dataTable>

</h:form> 


</p:panel>	

</ui:define>
</ui:composition>